package com.shark.open.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shark.model.erp.NozModel;
import com.shark.open.config.ReqContext;
import com.shark.open.criteria.NozCriteria;
import com.shark.open.mapper.NozMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class NozService extends ServiceImpl<NozMapper, NozModel> {
    public List<NozModel> listNoz(NozCriteria criteria) {
        SignUtils.checkSign(criteria);
        criteria.setGroupId(ReqContext.getContext().getGroupId());
        return this.lambdaQuery()
                .eq(NozModel::getGroupId, criteria.getGroupId())
                .eq(NozModel::getStationId, criteria.getStationId())
                .orderByAsc(NozModel::getNozNo)
                .list();
    }
}